﻿@model PortalWeb.Models.SelectUserRolesViewModel

@{
    Layout = null;
    ViewBag.Title = "使用者角色" + @Html.DisplayFor(model => model.UserName);
}

@using (Ajax.BeginForm("UserRoles", "User", new AjaxOptions
{
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    OnSuccess = "OnSuccess"
}, new { encType = "multipart/form-data", name = "myform" }))
{
    @Html.AntiForgeryToken()
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="myModalLabel" class="modal-title">@ViewBag.Title</h4>
        </div>
        <div class="modal-body">
            @Html.ValidationSummary(true)
            <div class="form-group">
                <div class="col-md-10">
                    @Html.HiddenFor(model => model.UserName)
                </div>
            </div>

            <h4>选择要加入的角色</h4>
            <hr/>

            <table>
                <tr>
                    <th>
                        勾选
                    </th>
                    <th>
                        角色
                    </th>
                </tr>
                @Html.EditorFor(model => model.Roles)
            </table>
        </div>
        <div class="modal-footer">
            <button type="submit" class="btn btn-primary">保存</button>
            <button class="btn  btn-default" data-dismiss="modal" aria-hidden="true">取消</button>
        </div>
    </div>
}
